#include <iostream>
using namespace std;

/*
    系统提供的拷贝构造函数
        Cat (const Cat &other)
        {
            this->name = other.name;
            this->age = other.age;
        }
*/


class Cat
{
public:
    Cat(string name,int age)
    {
        cout << "有参构造函数" << endl;
        this->name = name;
        this->age = age;
    }
    Cat()
    {
        cout << "无参构造函数" << endl;
    }
    Cat(const Cat &other)
    {
        cout << "拷贝构造函数" << endl;
    }
    void show()
    {
        cout << "猫的信息：" << endl;
        cout << "名字：" << this->name << endl;
        cout << "年龄：" << this->age << endl;
    }
private:
    string name;
    int age;

};


int main()
{
    Cat c1("小猫",3);
    Cat c2 = c1;

    c1.show();
    c2.show();



    return 0;
}